package com.community.charge.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.community.charge.domain.vo.ChargeItemVo;
import com.community.charge.domain.vo.CommunityVo;
import com.community.charge.domain.vo.HouseVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.community.common.annotation.Excel;
import com.community.common.core.domain.BaseEntity;

/**
 * 账单管理对象 bill
 * 
 * @author ruoyi
 * @date 2025-10-28
 */
@Data
public class Bill extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 账单ID */
    private Long billId;

    /** 社区ID */
    @Excel(name = "社区ID")
    private Long communityId;

    /** 房屋ID */
    @Excel(name = "房屋ID")
    private Long houseId;

    /** 收费项目ID */
    @Excel(name = "收费项目ID")
    private Long chargeItemId;

    /** 账单日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "账单日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date billDate;

    /** 金额 */
    @Excel(name = "金额")
    private BigDecimal amount;

    /** 截止日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "截止日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date dueDate;

    /** 期数 */
    private String period;

    /** 交付状态(未支付/已支付/已逾期) */
    @Excel(name = "交付状态(未支付/已支付/已逾期)")
    private Integer status;

    /** 已支付金额 */
    @Excel(name = "已支付金额")
    private BigDecimal paidAmount;

    /** 支付时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date paidTime;

    /** 支付方式 */
    private String paymentMethod;

    /** 账单编号 */
    private String billNo;

    /** 是否预账单 */
    private Long isPreBill;

    /** 描述 */
    private String description;

    //映射属性
    private CommunityVo communityVo;
    private HouseVo houseVo;
    private ChargeItemVo chargeItemVo;

    // 添加临时名称字段（方便前端直接使用）
    @Excel(name = "社区名称")
    private String communityName;

    @Excel(name = "房屋名称")
    private String houseName;

    @Excel(name = "收费项目名称")
    private String chargeItemName;

    public void setBillId(Long billId) 
    {
        this.billId = billId;
    }

    public Long getBillId() 
    {
        return billId;
    }

    public void setCommunityId(Long communityId) 
    {
        this.communityId = communityId;
    }

    public Long getCommunityId() 
    {
        return communityId;
    }

    public void setHouseId(Long houseId) 
    {
        this.houseId = houseId;
    }

    public Long getHouseId() 
    {
        return houseId;
    }

    public void setChargeItemId(Long chargeItemId) 
    {
        this.chargeItemId = chargeItemId;
    }

    public Long getChargeItemId() 
    {
        return chargeItemId;
    }

    public void setBillDate(Date billDate) 
    {
        this.billDate = billDate;
    }

    public Date getBillDate() 
    {
        return billDate;
    }

    public void setAmount(BigDecimal amount) 
    {
        this.amount = amount;
    }

    public BigDecimal getAmount() 
    {
        return amount;
    }

    public void setDueDate(Date dueDate) 
    {
        this.dueDate = dueDate;
    }

    public Date getDueDate() 
    {
        return dueDate;
    }

    public void setPeriod(String period) 
    {
        this.period = period;
    }

    public String getPeriod() 
    {
        return period;
    }

    public void setStatus(Integer status)
    {
        this.status = status;
    }

    public Integer getStatus()
    {
        return status;
    }

    public void setPaidAmount(BigDecimal paidAmount) 
    {
        this.paidAmount = paidAmount;
    }

    public BigDecimal getPaidAmount() 
    {
        return paidAmount;
    }

    public void setPaidTime(Date paidTime) 
    {
        this.paidTime = paidTime;
    }

    public Date getPaidTime() 
    {
        return paidTime;
    }

    public void setPaymentMethod(String paymentMethod) 
    {
        this.paymentMethod = paymentMethod;
    }

    public String getPaymentMethod() 
    {
        return paymentMethod;
    }

    public void setBillNo(String billNo) 
    {
        this.billNo = billNo;
    }

    public String getBillNo() 
    {
        return billNo;
    }

    public void setIsPreBill(Long isPreBill) 
    {
        this.isPreBill = isPreBill;
    }

    public Long getIsPreBill() 
    {
        return isPreBill;
    }

    public void setDescription(String description) 
    {
        this.description = description;
    }

    public String getDescription() 
    {
        return description;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("billId", getBillId())
            .append("communityId", getCommunityId())
            .append("houseId", getHouseId())
            .append("chargeItemId", getChargeItemId())
            .append("billDate", getBillDate())
            .append("amount", getAmount())
            .append("dueDate", getDueDate())
            .append("period", getPeriod())
            .append("status", getStatus())
            .append("paidAmount", getPaidAmount())
            .append("paidTime", getPaidTime())
            .append("paymentMethod", getPaymentMethod())
            .append("billNo", getBillNo())
            .append("isPreBill", getIsPreBill())
            .append("description", getDescription())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
